Fix GoReleaser configuration for v2 syntax#14
Conversation
There was a problem hiding this comment.
Pull request overview
Updates release tooling/configuration to support GoReleaser v2, while also modernizing the Go module/toolchain and dependency set.
Changes:
- Migrate
.goreleaser.yamlto GoReleaser v2 syntax (addversion: 2, update archives/snapshot/changelog filters). - Bump
go.modto Go 1.22 and upgrade multiple direct/indirect dependencies (with correspondinggo.sumupdates). - Remove the
go1.16build constraint fromdownloads/tarball_registry.go.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.goreleaser.yaml |
Migrates config to GoReleaser v2 syntax; adjusts archive naming/checksum and snapshot template. |
go.mod |
Raises Go toolchain version to 1.22 and upgrades dependencies. |
go.sum |
Updates module checksums to match the new dependency graph. |
downloads/tarball_registry.go |
Removes legacy build tags (file now builds unconditionally). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| module github.com/datacharmer/dbdeployer | ||
|
|
||
| go 1.18 | ||
| go 1.22 |
There was a problem hiding this comment.
go.mod now declares Go 1.22, but the repository CI workflow still sets up Go ^1.18 (see .github/workflows/all_tests.yml:16-20). This will make CI and local builds inconsistent and can cause CI failures (toolchain may refuse to build a module requiring a newer Go version). Either bump the workflow Go version to >=1.22, or keep the go directive at the CI/tooling-supported version.
| go 1.22 | |
| go 1.18 |
| go 1.22 | ||
|
|
||
| require ( | ||
| github.com/alexeyco/simpletable v0.0.0-20180729223640-1fa9009f1080 | ||
| github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195 | ||
| github.com/dustin/go-humanize v1.0.0 | ||
| github.com/go-sql-driver/mysql v1.4.1 | ||
| github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443 | ||
| github.com/alexeyco/simpletable v1.0.0 | ||
| github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de | ||
| github.com/dustin/go-humanize v1.0.1 | ||
| github.com/go-sql-driver/mysql v1.7.1 | ||
| github.com/nightlyone/lockfile v1.0.0 | ||
| github.com/pkg/errors v0.9.1 | ||
| github.com/rogpeppe/go-internal v1.9.0 | ||
| github.com/spf13/cobra v1.4.0 | ||
| github.com/spf13/pflag v1.0.5 | ||
| github.com/stretchr/testify v1.8.0 | ||
| github.com/rogpeppe/go-internal v1.12.0 | ||
| github.com/spf13/cobra v1.8.1 | ||
| github.com/spf13/pflag v1.0.6 | ||
| github.com/stretchr/testify v1.9.0 | ||
| github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 | ||
| golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e | ||
| golang.org/x/term v0.13.0 | ||
| golang.org/x/text v0.13.0 | ||
| golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 | ||
| golang.org/x/term v0.25.0 | ||
| golang.org/x/text v0.19.0 | ||
| jaytaylor.com/html2text v0.0.0-20200412013138-3577fbdbcff7 |
There was a problem hiding this comment.
The PR title/description and linked issue focus on updating .goreleaser.yaml for GoReleaser v2, but this change also bumps the module Go version to 1.22 and upgrades multiple dependencies. If this is intentional, it should be called out explicitly (and ideally justified) in the PR description/issue; otherwise consider splitting the Go/toolchain+dependency upgrades into a separate PR to keep the release-config change isolated.
| {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }} | ||
|
|
||
| checksum: | ||
| name_template: 'checksums.txt' | ||
|
|
There was a problem hiding this comment.
The new archive name_template/checksum settings appear incompatible with existing release artifact consumers in this repo. For example scripts/dbdeployer-install.sh downloads dbdeployer-${version}.osx.tar.gz/dbdeployer-${version}.linux.tar.gz and verifies ${filename}.sha256, but this config will produce assets like dbdeployer_<version>_darwin_amd64.tar.gz plus a single checksums.txt. If GoReleaser is becoming the source of release assets, either adjust the templates (and possibly OS naming, e.g. darwin->osx) to preserve the current artifact contract, or update the installer/build tooling to match the new naming + checksum scheme.
| {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }} | |
| checksum: | |
| name_template: 'checksums.txt' | |
| {{ .ProjectName }}-{{ .Version }}.{{- if eq .Os "darwin" }}osx{{ else }}{{ .Os }}{{ end }} | |
| checksum: | |
| name_template: '{{ .ArtifactName }}.sha256' | |
| split: true |
|
@gemini-code-assist review |
|
@claude review |
There was a problem hiding this comment.
Code Review
This pull request updates the GoReleaser configuration to the v2 syntax, which is a necessary maintenance task. The changes correctly replace deprecated fields like replacements and snapshot.name_template with their v2 equivalents. The Go version for the module is also updated to 1.22, and dependencies are refreshed. My main feedback concerns a potential breaking change in the naming of release artifacts due to the new name_template in the archives section. I've suggested a modification to maintain backward compatibility for consumers of these artifacts.
| name_template: >- | ||
| {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }} |
There was a problem hiding this comment.
The new name_template changes the naming convention for release archives. The previous configuration produced names like ..._Darwin_x86_64, while the new template will produce ..._darwin_amd64. This could be a breaking change for users who rely on the old naming scheme.
To maintain backward compatibility with the previous archive names, you can use GoReleaser's template functions and variables. Specifically, {{ .Os | title }} will capitalize the OS name, and {{ .Amd64 }} will replace amd64 with x86_64.
Consider updating the name_template to preserve the existing naming convention.
name_template: >-
{{ .ProjectName }}_{{ .Version }}_{{ .Os | title }}_{{ .Amd64 }}|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b4b9849 to
4566fd2
Compare
Summary
.goreleaser.yamlto GoReleaser v2 syntaxversion: 2declarationreplacementswithname_templatein archivesarchives.format_overrideswithformatssnapshot.name_templatetosnapshot.version_template'^chore:'to changelog exclusion filtersCloses #4
Test plan
goreleaser checkpasses with the new configgoreleaser release --snapshot --skip-publish --clean